import axios from '@/utils/request'

export const userLogin = (mobile, code) => {
  return axios({
    method: 'post',
    url: '/v1_0/authorizations',
    data: {
      mobile,
      code
    }
  })
}

export const getUserInfo = () => {
  return axios({
    method: 'GET',
    url: '/v1_0/user/profile'
  })
}

export const updateUserInfo = data => {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data
  })
}

// 修改用户头像
export const updateUserAvatar = fd => {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data: fd
  })
}
